package com.pair.micro.common.exception;

import com.pair.micro.common.constant.MicroBusinessError;
import com.pair.micro.common.constant.MicroSystemError;
import lombok.Getter;

/**
 * 安全性异常
 *
 *
 * @author xubz
 * @since
 */
public class MicroSecurityException extends RuntimeException {

  @Getter private MicroBusinessError microBusinessError;

  @Getter private MicroSystemError microSystemError;

  public MicroSecurityException() {
    super(MicroSystemError.SYS_00081.getMsg());
  }

  public MicroSecurityException(MicroBusinessError microBusinessError) {
    super(microBusinessError.getMsg());
    this.microBusinessError = microBusinessError;
  }

  public MicroSecurityException(MicroSystemError microSystemError) {
    super(microSystemError.getMsg());
    this.microSystemError = microSystemError;
  }

  public MicroSecurityException(MicroBusinessError microBusinessError, String exception) {
    super(exception);
    this.microBusinessError = microBusinessError;
  }
}
